package com.woniuxy.redenvelope.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.commons.service.FeignUserService;
import com.woniuxy.redenvelope.entity.Record;
import com.woniuxy.redenvelope.mapper.KillRedEnvelopeMapper;
import com.woniuxy.redenvelope.mapper.RecordMapper;
import com.woniuxy.redenvelope.service.KillRedEnvelopeSerice;
import com.woniuxy.redenvelope.service.RecordSerice;
import com.woniuxy.redenvelope.vo.AddKillVo;
import com.woniuxy.redenvelope.vo.RecordVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;

@Service
@Slf4j
public class RecordServiceImpl implements RecordSerice {

    @Resource
    private RecordMapper recordMapper;



    @Override
    public PageInfo<RecordVo> findAll(Integer currentPage, Integer pageSize, String name) {
        PageHelper.startPage(currentPage, pageSize);
        List<RecordVo> list = recordMapper.findAll(name);
        PageInfo<RecordVo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

}
